

package top.continew.admin.question.manger.service.model;

import cn.hutool.core.date.DateUtil;
import lombok.Data;

import java.util.List;
import java.util.Objects;

/**
 * Created with Mac IntelliJ IDEA
 *
 * @Title: ExamPaperQuery
 * @Package: top.continew.question.controller.model
 * @Author: RHY
 * @Description:
 * @Date: 2020/3/3 11:13
 */
@Data
public class ExamPaperQuery {
    private String startTime;
    private String endTime;
    private Long startTimeLong;
    private Long endTimeLong;
    private List<String> subject;
    private List<String> examType;
    private List<String> level;
    private List<String> area;
    private String paperType;
    private String paperStatus;
    private String year;
    private String isPublic;
    private String paperTitle;
    private String teacher;
    private String teacherCheck;
    private String teacherReview;
    private String qualifiedStatus;

    public void strToDate() {
        try {
            this.startTimeLong = Objects.requireNonNull(DateUtil.parse(startTime, "yyyy-MM-dd HH:mm:ss")).getTime();
            this.endTimeLong = Objects.requireNonNull(DateUtil.parse(endTime, "yyyy-MM-dd HH:mm:ss")).getTime();
        } catch (NullPointerException e) {
            this.startTimeLong = 0L;
            this.endTimeLong = 0L;
        }
    }
}
